import React from 'react'
import { withRouter } from 'react-router-dom'

function Header(props) {
  console.log('Header组件接收的props', props)
  return (
    <div className='page-header'>
      <h2>React Router Demo</h2>
      <button onClick={() => props.history.goBack()}>后退</button>&emsp;
      <button onClick={() => props.history.goForward()}>前进</button>
      &emsp;
      <button onClick={() => props.history.go(-2)}>go</button>
    </div>
  )
}

export default withRouter(Header)
